# encoding: utf-8
# @project: st2111 
# @file: re_repetition_non_greedy.py.py
# @time: 2023/4/6 14:31
# @author: abcque
# @license: (C) Copyright 2013-2021
# @contact: abcque@outlook.com
# @IDE: PyCharm
# @desc:

from chapter5.regular_expression.testre.re_test_patterns import test_patterns

if __name__ == "__main__":
    text = 'abbaabbba'
    patterns = [
        ("ab*?", "字符 a 后面跟着 0 个或者多个字符 b，次数尽可能的少"),
        ("ab+?", "字符 a 后面跟着 1 个或者多个字符 b，次数尽可能的少"),
        ("ab??", "字符 a 后面跟着 0 个或者 1 个字符 b，次数尽可能的少"),
        ("ab{3}?", "字符 a 后面跟着 3 个字符 b"),
        ("ab{2,3}?", "字符 a 后面跟着 2 个或者 3 个字符 b，次数尽可能的少"),
        # ("ab{2,}", "字符 a 后面跟着 2 个或者多个字符 b"),
        # ("ab{,3}", "字符 a 后面跟着 0 个到 3 个字符 b"),
    ]
    test_patterns(text=text, patterns=patterns)